﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;

namespace DAL
{
    public class Factory:IFactory
    {
        private SqlConnection conn;
        public Factory()
        {
            string connectionString = ConfigurationManager.ConnectionStrings["projectbConnection"].ToString();
            conn = new SqlConnection(connectionString);
        }
    
        public ILevelRepository getLevelOperations()
        {
            return new LevelRepository(conn);
        }
        public IStudentRepository getStudentOperations()
        {
            return new StudentRepository(conn);
        }
        public ISaveRepository saveOperations()
        {
            return new SaveRepository(conn);
        }
        public ITeacherRepository getTeacherOperations()
        {
            return new TeacherRepository(conn);
        }
        

    }
}
